import request from '@/utils/request'
import upload from '@/utils/upload'

// 查询货源信息列表
export function getSourceList(data) {
	return request({
		url: '/logi/logi/goodSource/list',
		method: 'post',
		data:data
	})
}

// 修改货源信息
export function updateSourceProfile(data) {
	return request({
		url: '/logi/logi/goodSource',
		method: 'put',
		data: data
	})
}

// 新增货源信息
export function addSource(data) {
	return request({
		url: '/logi/logi/goodSource',
		method: 'post',
		data: data
	})
}

// 删除货源信息
export function deleteSource(ids) {
	return request({
		url: '/logi/logi/goodSource/' + ids,
		method: 'delete'
	})
}

// 获取货源信息详细信息
export function getSourceDetails(id) {
	return request({
		url: '/logi/logi/goodSource/'+id,
		method: 'get'
	})
}
// 上传文件
export function uploadFile(tempFiles) {
    return upload({
		url: '/sys/oss/upload',
		filePath:tempFiles[0].path,
		file:tempFiles[0].file
    })
}